<!doctype html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>司法厅-上报</title>
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <script src="/static/js/common/common.js" type="text/javascript"></script>
    <link href="/webjars/miniui/css/demo.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/default.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/voiceinteraction/voiceinteraction.css" rel="stylesheet" type="text/css" />
    <style>
        .discell {
            text-align:right;
            width:30%;
        }
        .input {
            width:70%;
        }
        table {
            border-collapse:separate;
            border-spacing:10px;
        }
    </style>
</head>
<body>
<div class="mini-fit" style="margin-bottom: 40px;">
    <form id="form1" method="post" style="height:100%;width: 100%;overflow-x: auto;overflow-y: auto;">
        <!-- 用户 编辑框START-->
        <div id="editform" class="form" style="padding:10px;">
            <input name="id" id="id" class="mini-hidden" style="width: 100%;" readonly value="${resultMap.id!''}" />
            <input name="priNum" id="priNum" class="mini-hidden" style="width: 100%" readonly value="${resultMap.priNum!''}" />
            <table class="form-table" align="center">
                <tr>
                    <td style="font-weight: bold;text-align: left">服刑人员信息:</td>
                </tr>
                <tr>
                    <td class="discell">服刑人员姓名:</td>
                    <td class="input">
                        <input name="pname" id="pname" class="mini-textbox" value="${resultMap.pname!''}" style="width: 100%"
                               readonly />
                    </td>
                </tr>
                <tr>
                    <td class="discell">服刑人员户籍地址:</td>
                    <td class="input">
                        <input name="hjdz" id="hjdz" class="mini-textbox" value="${resultMap.hjdz!''}" style="width: 100%"
                               readonly />
                    </td>
                </tr>
                <tr>
                    <td class="discell">服刑人员服刑单位:</td>
                    <td class="input">
                        <input name="fxdw" id="fxdw" class="mini-textbox" value="${resultMap.fxdw!''}" style="width: 100%"
                               readonly />
                    </td>
                </tr>
                <tr>
                    <td class="discell">服刑人员释放时间:</td>
                    <td class="input">
                        <input name="sfsj" id="sfsj" class="mini-textbox" value="${resultMap.sfsj!''}" style="width: 100%"
                               readonly />
                    </td>
                </tr>
                <tr>
                    <td class="discell">附件信息:</td>
                    <td class="input">
                        <input type="button" onclick="onFileUpload()" value="上传" style="width: 150px" />
                        <span id="msg1"></span>
                        <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                    </td>
                </tr>
                <tr>
                    <td style="font-weight: bold;text-align: left">监狱局信息:</td>
                </tr>
                <tr>
                    <td class="discell">监狱意见:</td>
                    <td class="input">
                        <input name="jyyj" id="jyyj" class="mini-textarea" value="${resultMap.jyyj!''}" style="width: 100%;height: 100px" readonly
                               style="width: 100%" />
                    </td>
                </tr>
                <tr>
                    <td style="font-weight: bold;text-align: left">监狱局信息:</td>
                </tr>
                <tr>
                    <td class="discell">监狱局意见:</td>
                    <td class="input">
                        <input name="jyjyj" id="jyjyj" class="mini-textarea" value="${resultMap.jyjyj!''}" style="width: 100%;height: 100px" readonly
                               style="width: 100%" />
                    </td>
                </tr>
                <tr>
                    <td style="font-weight: bold;text-align: left">司法厅信息:</td>
                </tr>
                <tr>
                    <td class="discell">司法厅联系人:</td>
                    <td class="input">
                        <input name="sftlxr" id="sftlxr" class="mini-textbox" value="${resultMap.sftlxr!''}" required="true" style="width: 100%"
                               emptyText="司法厅联系人" />
                    </td>
                </tr>
                <tr>
                    <td class="discell">司法厅联系方式:</td>
                    <td class="input">
                        <input name="sftphone" id="sftphone" class="mini-textbox" value="${resultMap.sftphone!''}" style="width: 100%"
                               emptyText="手机号码" />
                    </td>
                </tr>
                <tr>
                    <td class="discell">司法厅联系方式:</td>
                    <td class="input">
                        <input name="sfttel" id="sfttel" class="mini-textbox" value="${resultMap.sfttel!''}" style="width: 100%"
                               emptyText="固定电话(区号-区段号码)" />
                    </td>
                </tr>
                <tr>
                    <td class="discell">司法厅意见:</td>
                    <td class="input">
                        <input name="sftyj" id="sftyj" class="mini-textarea" value="${resultMap.sftyj!''}" style="width: 100%;height: 100px"
                               required="true" style="width: 100%" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
</div>
<div style="position: absolute;bottom: 0;line-height:40px;width: 100%;border-top:1px solid #dfdfdf;text-align: center">
    <a class="mini-button" iconCls="fa-save" plain="true" onclick="saveData()" style="font-size: 15px">上报</a>
    <a class="mini-button" iconCls="fa-close" plain="true" onclick="onCancel()">取消</a>
</div>

<script type="text/javascript">
    mini.parse();
    var form = new mini.Form("form1");

    window.onload = function (){
        $('#msg1').text("上传成功" + ${count1!''} + "条!")
    }

    /**
     * 保存数据
     */
    function saveData() {
        form.validate();
        if (form.isValid() == false) {
            return;
        }
        var data = form.getData();
        var json = mini.encode(data);
        $.ajax({
            url: "/azbj/ksywxt/apply/save",
            data: {data: json},
            type: "post",
            success: function (success) {
                if (success.code == 1) {
                    mini.alert("保存成功", "成功", window.CloseOwnerWindow);
                } else if (success.code == 5599) {
                    mini.alert(success.message);
                } else {
                    mini.alert("保存失败");
                }
            }, error: function () {
                mini.unmask(document.body);
                mini.alert("系统异常");
            }
        })
    }

    // 衔接失败上传附件
    function onFileUpload() {//taskId为35是衔接信息的附件
        commonEdit("/upload/user/uploadAppendixfileWork/view?1=1&id=${resultMap.xjxxId!''}&priNum=${resultMap.priNum!''}&taskId=35", null, null, 600, 400, true, true, true,callback);
        function callback(){
            $.ajax({
                url: "/upload/downloadAppendixFile/getCountall?1=1&priNum=${count1!''}&taskId=35",
                type: "get",
                success: function(success){
                    $('#msg1').text("上传成功" + success.data + "条!")
                }
            })
        }
    }
</script>
</body>
</html>